<?include("../session.php");include("../entity.php");include("../field.php");header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); // disable IE cachingheader( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" );header( "Cache-Control: no-cache, must-revalidate" );header( "Pragma: no-cache" );header('Content-Type: text/html; charset=UTF-8');
$idEntidad=$_GET["i"];$parent=$_GET["p"];$layout=$_GET["l"];
$entities=unserialize($_SESSION[constant(CT_ENTITIES.PROJECT)]);foreach($entities as $entity){	//busca en las hijas si tiene	if ($entity->getIdEntity()!=$idEntidad && $entity->getHasChilds()){		$find=false;		foreach($entity->getEntitiesChilds() as $entityChild){			if ($entityChild->getIdEntity()==$idEntidad){				$tempEntity=$entityChild;				$find=true;			}						if ($find){				foreach($entity->getFields() as $field)				{					if ($field->getIsKey())						$parentKey=$field->getName();				}									$entity=$tempEntity;			}			$find=false;		}			}		if ($entity->getIdEntity()==$idEntidad){		$html="<table><tr>";		//TODO montar todos los posibles hijos a modo de listado, pero editable		foreach($entity->getFields() as $field){			$html.="<td>".$field->getName()."</td>";		}		$html.="</tr></table>";			}}
echo "S#".$idEntidad."#".$html;
?>
